const chalk = require('chalk');

module.exports = (opt, app) => {
  return async function formatResponse(ctx, next) {
    console.log(chalk.blue.bgBlack.bold('response middleware'));

    await next();
    ctx.body = {
      code: 200,
      data: ctx.body,
    };
  };
};
